/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ged.impl;

import ged.Font;
import ged.GedPackage;
import ged.fontName;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Font</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ged.impl.FontImpl#isLabelBold <em>Label Bold</em>}</li>
 *   <li>{@link ged.impl.FontImpl#isLabelItalic <em>Label Italic</em>}</li>
 *   <li>{@link ged.impl.FontImpl#isLabelStrikeThrough <em>Label Strike Through</em>}</li>
 *   <li>{@link ged.impl.FontImpl#isLabelUnderline <em>Label Underline</em>}</li>
 *   <li>{@link ged.impl.FontImpl#getFname <em>Fname</em>}</li>
 *   <li>{@link ged.impl.FontImpl#getFontHeight <em>Font Height</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FontImpl extends EObjectImpl implements Font
{
  /**
   * The default value of the '{@link #isLabelBold() <em>Label Bold</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelBold()
   * @generated
   * @ordered
   */
  protected static final boolean LABEL_BOLD_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isLabelBold() <em>Label Bold</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelBold()
   * @generated
   * @ordered
   */
  protected boolean labelBold = LABEL_BOLD_EDEFAULT;

  /**
   * The default value of the '{@link #isLabelItalic() <em>Label Italic</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelItalic()
   * @generated
   * @ordered
   */
  protected static final boolean LABEL_ITALIC_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isLabelItalic() <em>Label Italic</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelItalic()
   * @generated
   * @ordered
   */
  protected boolean labelItalic = LABEL_ITALIC_EDEFAULT;

  /**
   * The default value of the '{@link #isLabelStrikeThrough() <em>Label Strike Through</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelStrikeThrough()
   * @generated
   * @ordered
   */
  protected static final boolean LABEL_STRIKE_THROUGH_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isLabelStrikeThrough() <em>Label Strike Through</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelStrikeThrough()
   * @generated
   * @ordered
   */
  protected boolean labelStrikeThrough = LABEL_STRIKE_THROUGH_EDEFAULT;

  /**
   * The default value of the '{@link #isLabelUnderline() <em>Label Underline</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelUnderline()
   * @generated
   * @ordered
   */
  protected static final boolean LABEL_UNDERLINE_EDEFAULT = false;

  /**
   * The cached value of the '{@link #isLabelUnderline() <em>Label Underline</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #isLabelUnderline()
   * @generated
   * @ordered
   */
  protected boolean labelUnderline = LABEL_UNDERLINE_EDEFAULT;

  /**
   * The default value of the '{@link #getFname() <em>Fname</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFname()
   * @generated
   * @ordered
   */
  protected static final String FNAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getFname() <em>Fname</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFname()
   * @generated
   * @ordered
   */
  protected String fname = FNAME_EDEFAULT;

  /**
   * The default value of the '{@link #getFontHeight() <em>Font Height</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFontHeight()
   * @generated
   * @ordered
   */
  protected static final int FONT_HEIGHT_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getFontHeight() <em>Font Height</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFontHeight()
   * @generated
   * @ordered
   */
  protected int fontHeight = FONT_HEIGHT_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected FontImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GedPackage.Literals.FONT;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isLabelBold()
  {
    return labelBold;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabelBold(boolean newLabelBold)
  {
    boolean oldLabelBold = labelBold;
    labelBold = newLabelBold;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__LABEL_BOLD, oldLabelBold, labelBold));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isLabelItalic()
  {
    return labelItalic;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabelItalic(boolean newLabelItalic)
  {
    boolean oldLabelItalic = labelItalic;
    labelItalic = newLabelItalic;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__LABEL_ITALIC, oldLabelItalic, labelItalic));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isLabelStrikeThrough()
  {
    return labelStrikeThrough;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabelStrikeThrough(boolean newLabelStrikeThrough)
  {
    boolean oldLabelStrikeThrough = labelStrikeThrough;
    labelStrikeThrough = newLabelStrikeThrough;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__LABEL_STRIKE_THROUGH, oldLabelStrikeThrough, labelStrikeThrough));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public boolean isLabelUnderline()
  {
    return labelUnderline;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLabelUnderline(boolean newLabelUnderline)
  {
    boolean oldLabelUnderline = labelUnderline;
    labelUnderline = newLabelUnderline;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__LABEL_UNDERLINE, oldLabelUnderline, labelUnderline));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getFname()
  {
    return fname;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFname(String newFname)
  {
    String oldFname = fname;
    fname = newFname;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__FNAME, oldFname, fname));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getFontHeight()
  {
    return fontHeight;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFontHeight(int newFontHeight)
  {
    int oldFontHeight = fontHeight;
    fontHeight = newFontHeight;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GedPackage.FONT__FONT_HEIGHT, oldFontHeight, fontHeight));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GedPackage.FONT__LABEL_BOLD:
        return isLabelBold();
      case GedPackage.FONT__LABEL_ITALIC:
        return isLabelItalic();
      case GedPackage.FONT__LABEL_STRIKE_THROUGH:
        return isLabelStrikeThrough();
      case GedPackage.FONT__LABEL_UNDERLINE:
        return isLabelUnderline();
      case GedPackage.FONT__FNAME:
        return getFname();
      case GedPackage.FONT__FONT_HEIGHT:
        return getFontHeight();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GedPackage.FONT__LABEL_BOLD:
        setLabelBold((Boolean)newValue);
        return;
      case GedPackage.FONT__LABEL_ITALIC:
        setLabelItalic((Boolean)newValue);
        return;
      case GedPackage.FONT__LABEL_STRIKE_THROUGH:
        setLabelStrikeThrough((Boolean)newValue);
        return;
      case GedPackage.FONT__LABEL_UNDERLINE:
        setLabelUnderline((Boolean)newValue);
        return;
      case GedPackage.FONT__FNAME:
        setFname((String)newValue);
        return;
      case GedPackage.FONT__FONT_HEIGHT:
        setFontHeight((Integer)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.FONT__LABEL_BOLD:
        setLabelBold(LABEL_BOLD_EDEFAULT);
        return;
      case GedPackage.FONT__LABEL_ITALIC:
        setLabelItalic(LABEL_ITALIC_EDEFAULT);
        return;
      case GedPackage.FONT__LABEL_STRIKE_THROUGH:
        setLabelStrikeThrough(LABEL_STRIKE_THROUGH_EDEFAULT);
        return;
      case GedPackage.FONT__LABEL_UNDERLINE:
        setLabelUnderline(LABEL_UNDERLINE_EDEFAULT);
        return;
      case GedPackage.FONT__FNAME:
        setFname(FNAME_EDEFAULT);
        return;
      case GedPackage.FONT__FONT_HEIGHT:
        setFontHeight(FONT_HEIGHT_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GedPackage.FONT__LABEL_BOLD:
        return labelBold != LABEL_BOLD_EDEFAULT;
      case GedPackage.FONT__LABEL_ITALIC:
        return labelItalic != LABEL_ITALIC_EDEFAULT;
      case GedPackage.FONT__LABEL_STRIKE_THROUGH:
        return labelStrikeThrough != LABEL_STRIKE_THROUGH_EDEFAULT;
      case GedPackage.FONT__LABEL_UNDERLINE:
        return labelUnderline != LABEL_UNDERLINE_EDEFAULT;
      case GedPackage.FONT__FNAME:
        return FNAME_EDEFAULT == null ? fname != null : !FNAME_EDEFAULT.equals(fname);
      case GedPackage.FONT__FONT_HEIGHT:
        return fontHeight != FONT_HEIGHT_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (labelBold: ");
    result.append(labelBold);
    result.append(", labelItalic: ");
    result.append(labelItalic);
    result.append(", labelStrikeThrough: ");
    result.append(labelStrikeThrough);
    result.append(", labelUnderline: ");
    result.append(labelUnderline);
    result.append(", fname: ");
    result.append(fname);
    result.append(", fontHeight: ");
    result.append(fontHeight);
    result.append(')');
    return result.toString();
  }

} //FontImpl
